<?php

require_once "spyc.php";

class Config
{
    private static $__instance = NULL;

    public $baseurl = '';
    public $resurl = '';
    public $title = 'Untitled';
    public $jsfiles = array();
    public $cssfiles = array();

    public static function getInstance () {
        if (Config::$__instance == NULL) {
            Config::$__instance = new Config();
        }
        return self::$__instance;
    }

    public static function loadFile ($f) {
        $spyc = new Spyc();
        return $spyc->YAMLLoad($f);
    }

    private function Config () {
        $cfg = Config::loadFile('config.yaml');
        foreach ($cfg as $key=>$value) {
            $this->$key = $value;
        }
    }
}



